package com.lutzyt.delivery.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 *
 * @author zyt
 */
@Data
@TableName("order_item")
public class OrderItem {
  /**
   *
   */
  @TableId(value = "id", type = IdType.AUTO)
  private Integer id;
  /**
   * 订单id
   */
  @TableField("order_id")
  private Integer orderId;
  /**
   * 商品id
   */
  @TableField("commodity_id")
  private Integer commodityId;

  private String commodityName;

  private String commodityImage;
  /**
   * 商品单价
   */
  @TableField("price")
  private BigDecimal price;
  /**
   * 商品数量
   */
  @TableField("count")
  private Integer count;
  /**
   * 订单项总额
   */
  @TableField("amount")
  private BigDecimal amount;
  /**
   * 创建时间
   */
  @TableField("create_time")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createTime;
  /**
   * 逻辑删除
   */
  @TableField("deleted")
  private Integer deleted;
  /**
   * 版本
   */
  @TableField("fversion")
  private Integer fversion;
  /**
   * 备注
   */
  @TableField("remark")
  private String remark;

  @TableField(exist = false)
  private Commodity commodity;
}